<template>
  <u-navbar :bgColor="bgColor" :fixed="fixed" :titleStyle="titleStyle">
    <view slot="left" @click="handleBack">
      <u-icon v-if="back" name="arrow-left" size="19"></u-icon>
    </view>
    <view class="title" slot="center" :style="{ color: titleColor }">
      {{ title }}
    </view>
  </u-navbar>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    back: {
      type: Boolean,
      default: false
    },
    titleColor: {
      type: String,
      default: '#1D2129'
    },
    bgColor: {
      type: String,
      default: '#fff'
    },
    fixed: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      titleStyle: {
        fontSize: '36rpx',
        fontWeight: '600',
        fontFamily: 'PingFang SC',
        color: this.titleColor
      }
    }
  },
  methods: {
    handleBack() {
		uni.navigateBack({
			delta:1
		})
    }
  }
}
</script>

<style lang="scss" scoped>
.title {
  font-size: 36rpx;
  font-weight: 600;
}
</style>
